package com.xinghou.platform.server.api.bussiness.impl;

import com.xinghou.platform.dao.main.CardUseAreaDAO;
import com.xinghou.platform.model.main.CardUseAreaTag;
import com.xinghou.platform.server.api.bussiness.CardUseAreaService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by qingshengzheng on 16/7/6.
 */
@Service("cardUseAreaService")
public class CardUseAreaServiceImpl  implements CardUseAreaService{
  @Resource
    CardUseAreaDAO cardUseAreaDAO;
    @Override
    public void addCardUseArea(Integer cardid,String usearea) {
        String [] useareas=usearea.split("-");
        for(int i=0;i<useareas.length;i++)
        {
            CardUseAreaTag tag=new CardUseAreaTag();
            tag.setCardid(cardid);
            tag.setCreatetime(System.currentTimeMillis());
            tag.setTagid(Integer.parseInt(useareas[i]));
            cardUseAreaDAO.addCardUserArea(tag);
        }



    }
}
